<template>
  <div>
    <!-- 绑定事件 -->
    <!-- 语法v-on:事件名="事件处理函数" -->
    <p>购买数{{count}}</p>
    <button v-on:click="addFn">点击加一</button>
    <button  @click="subFn">点击减一</button>
    <button  @click="addFiveFn(5)">点击加五</button>    
  </div>
</template>

<script>
export default {
  name: 'CodeApp',

  data() {
    return {
      count:0
    };
  },

  mounted() {
    
  },

  methods: {
    addFn(){
      this.count++
    },
    subFn(){
      this.count--;
    },
    addFiveFn(n){
      this.count+=n
    },
  },
};
</script>

<style lang="scss" scoped>

</style>